package com.ticorp.framework.service.impl;

import com.sap.mw.jco.IRepository;
import com.sap.mw.jco.JCO;

public class StandardRepositoryManager {

	static private StandardRepositoryManager repositoryManager = null;
	private IRepository repository = null;
	
	public static synchronized StandardRepositoryManager getSingleInstance(){
		if(repositoryManager==null){
			repositoryManager = new StandardRepositoryManager();
		}
		return repositoryManager;
	}
	
	public synchronized IRepository createRepository(String client,String user,String password,String language,String host,String systemNumber){
		JCO.Client jcoClient = null;
		jcoClient  = JCO.createClient(client, user, password, language, host, systemNumber);			
		repository = JCO.createRepository(user,	jcoClient);
		return repository;
	}
	
}
